import React from "react";
import { storiesOf } from "@storybook/react";
import Button, { ButtonSize, ButtonType } from "./button";
import { action } from "@storybook/addon-actions";
import "../../styles/index.scss";

const defaultButton = () => (
  <Button onClick={action("hello")}> default Button</Button>
);
const buttonWithSize = () => (
  <>
    <Button size={ButtonSize.large} onClick={action("clicked")}>
      large Btn
    </Button>
    <Button size={ButtonSize.small} onClick={action("clicked")}>
      small Btn
    </Button>
  </>
);

const buttonType = () => (
  <>
    <Button btnType="primary" >primary Button</Button>
    <Button btnType="danger">danger Button</Button>
    <Button btnType="link" href="http://www.baidu.com">link Button</Button>
  </>
)
storiesOf("Button", module)
  .add("默认尺寸的Button", defaultButton)
  .add("不同尺寸的Button", buttonWithSize)
  .add("不同类型的Button",buttonType)
